package com.example.headlines.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;

import com.bumptech.glide.Glide;
import com.example.headlines.R;
import com.example.headlines.databinding.ActivityNewsBinding;

public class NewsActivity extends AppCompatActivity {
    private ActivityNewsBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news);
        binding = ActivityNewsBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        Intent intent = getIntent();
        binding.content.setText(intent.getStringExtra("content"));
        binding.title.setText(intent.getStringExtra("title"));
        binding.content.setMovementMethod(ScrollingMovementMethod.getInstance());
        Glide.with(this).load(intent.getStringExtra("img"))
                .into(binding.image);
    }
}